Procedure Syntax

Procedures are relatively simple to use with the API. The structure consists of two main tags. The <VBSCRIPT> tag is set to "True" or "False" using the value attribute name. The <CODE> tag contains the procedural code itself. Here's an example of a procedure:

<?xml version="1.0"?>
<XRKB>
  <OBJECT name="Procedure1" type="PROCEDURE" category="Objects">
    <VBSCRIPT value="TRUE"/>
    <CODE>
      @REM Call Object\n@DO Pikachu\n
    </CODE>
  </OBJECT>
</XRKB>

The <OBJECT> tag contains the same basic information as a call to GetItems would return. Note that there is \n characters in the procedure, this means that a carriage return/line feed (CRLF) is present. When calling ImportXML or ImportXMLFromFile you will need to parse out any CRLFs from the procedural code and replace them all with \n characters. This also applies to Reports, Events and Main Agendas.